Browse Source

cmake commit

Johannes Ruehle 12 years ago
parent
commit
bd48a2099a
2 changed files with 5 additions and 33 deletions
  1. 3 31
      CMakeLists.txt
  2. 2 2
      corefiles.cmake

+ 3 - 31
CMakeLists.txt

@@ -19,39 +19,11 @@ set("nice_${the_library}_LINKING_DEPENDENCIES" "nice_core")
 #####################################################
 message(STATUS "adding library ${the_library}")
 
-ADD_LIBRARY("nice_${the_library}" ${NICE_BUILD_LIBS_STATIC_SHARED} ${nice_${the_library}_HDR} ${nice_${the_library}_SRC})
-TARGET_LINK_LIBRARIES("nice_${the_library}" "${nice_${the_library}_LINKING_DEPENDENCIES}" ${Boost_LIBRARIES} ${OPENGL_LIBRARY} ${GLUT_LIBRARY} ${QT_LIBRARIES})
-SET_PROPERTY(TARGET "nice_${the_library}" PROPERTY FOLDER "library")
-INSTALL(TARGETS "nice_${the_library}" DESTINATION lib)
+nice_build_library()
 
+nice_add_progs()
 
-if(BUILD_CORE_PROGS)
-  message(STATUS "building progs:")
-  foreach(__progcpp ${nice_${the_library}_PROGFILES_SRC})
-    get_filename_component(__progname ${__progcpp} NAME_WE )
-    message(STATUS "progname: ${__progname} ${__progcpp}")
-    ADD_EXECUTABLE( ${__progname} ${__progcpp})
-    TARGET_LINK_LIBRARIES(${__progname} "nice_${the_library}")
-    INSTALL(TARGETS ${__progname} DESTINATION bin)
-	SET_PROPERTY(TARGET ${__progname} PROPERTY FOLDER "programs")
-  endforeach()
-endif()
-
-if(BUILD_CORE_TESTS)
-  INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIR})
-  message(STATUS "building tests:")
-  foreach(__testcpp ${nice_${the_library}_TESTFILES_SRC})
-    get_filename_component(__testname ${__testcpp} NAME_WE )
-    message(STATUS "unittest: ${__testname} ${__testcpp}")
-    
-    ADD_EXECUTABLE( ${__testname} ../templates/cppUnitTestRunner.cpp ${__testcpp})
-    TARGET_LINK_LIBRARIES(${__testname} "nice_${the_library}" ${CPPUNIT_LIBRARIES} )
-
-    INSTALL(TARGETS ${__testname} DESTINATION tests)
-	SET_PROPERTY(TARGET ${__testname} PROPERTY FOLDER "unittests")
-	ADD_TEST(${__testname} ${__testname})
-  endforeach()
-endif()
+nice_add_unittests()
 
 #####
  set(the_module "nice_${the_library}")

+ 2 - 2
corefiles.cmake

@@ -30,7 +30,7 @@ set(nice_optimization_HDR
 ./ParamLog.h
 ./MatrixIterativeOptimizer.h
 ./BrentLineSearcher.h
-#./AdaptiveDirectionRandomSearchOptimizer.h
+./AdaptiveDirectionRandomSearchOptimizer.h
 ./DerivativeBasedOptimizer.h
 ./Constraints.h
 ./NewtonMethodOptimizer.h
@@ -41,7 +41,7 @@ set(nice_optimization_HDR
 ./OptTestSuite.h
 ./EmptyLog.h
 ./FileLog.h
-#./CombinatorialOptimizer.h
+./CombinatorialOptimizer.h
 ./InequalityConstraints.h
 ./AdditionalIceUtils.h
 ./GoldenCutLineSearcher.h