]> ruin.nu Git - germs.git/blobdiff - src/CMakeLists.txt
Initial thread infrastructure and test
[germs.git] / src / CMakeLists.txt
index 9bdaf401e2ed40883a3a4fe745bd729b13ad6c52..6b5217e9497e5abd6cd2e4e3a93d5a02a608841b 100644 (file)
@@ -3,28 +3,31 @@ INCLUDE(CheckIncludeFileCXX)
 
 SET(CMAKE_VERBOSE_MAKEFILE OFF)
 
-#ADD_DEFINITIONS(-Wall -O2)
+#ADD_DEFINITIONS(-Wall -O2 -D__GTHREADS -D_REENTRANT
+#      -D_POSIX_PTHREAD_SEMANTICS -pthread)
 
 #ADD_DEFINITIONS(-Wall -pedantic -g -D_GLIBCXX_DEBUG)
-ADD_DEFINITIONS(-Wall -pedantic -g)
+ADD_DEFINITIONS(-Wall -pedantic -g -D__GTHREADS -D_REENTRANT
+       -D_POSIX_PTHREAD_SEMANTICS -pthread)
 
 #INCLUDE(CheckCXXSourceCompiles)
 
 INCLUDE_DIRECTORIES(.)
 ADD_LIBRARY(GeneSort geneorder genealgorithms modelidentifier genesorter model
-       models componenttree)
+       models componenttree threadgenesorter)
 
 ADD_EXECUTABLE(germs main.cpp)
 
+FIND_PACKAGE(Threads REQUIRED)
 CHECK_INCLUDE_FILE("doublefann.h" HAVE_FANN)
+SET(GENELIBS GeneSort ${CMAKE_THREAD_LIBS_INIT})
 
 IF (HAVE_FANN)
-       SET(GENELIBS doublefann GeneSort)
+       LIST(APPEND GENELIBS doublefann)
 ELSE(HAVE_FANN)
        INCLUDE_DIRECTORIES(. ${CMAKE_SOURCE_DIR}/fann/src/include)
        ADD_LIBRARY(doublefann ${CMAKE_SOURCE_DIR}/fann/src/doublefann.c)
        TARGET_LINK_LIBRARIES(GeneSort doublefann)
-       SET(GENELIBS GeneSort)
 ENDIF(HAVE_FANN)
 
 
@@ -41,4 +44,5 @@ ENDIF(HAVE_TR1)
 
 TARGET_LINK_LIBRARIES(germs ${GENELIBS})
 
+
 SUBDIRS(test)